define(function(require) {
	require("cordova!com.justep.cordova.plugin.barcodescanner");
	var Model = function() {
		this.callParent();
	};

	Model.prototype.modelLoad = function(event) { 
		console.log("Main.js modelLoad");
		// debugger;
		var api_url = window.app.base_url + window.app.ProductApi;
		var data = {};
		data.username = window.app.username;
		data.password = window.app.password;
		$.ajax({
			type : "POST",
			url : require.toUrl(api_url),
			data : {
				'data' : JSON.stringify(data)
			},
			dataType : 'json',
			success : function(res) {
				console.log(res);
				window.app.ProductApi_ret = res;
				return res;
			},
			error : function(e) {
				return {};
			}
		});
		this.comp("Warehouse_Window").load("Factory/Warehouse/Warehouse.w");
	};
 
	return Model;
});
